package org.swqsbssddqs.shortlink.project.dao.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Param;
import org.swqsbssddqs.shortlink.project.dao.entity.ShortLinkStatsTodayDO;

public interface ShortLinkStatsTodayMapper extends BaseMapper<ShortLinkStatsTodayDO> {
    @Insert("INSERT INTO " +
            "t_link_stats_today (full_short_url, date, today_pv, today_uv,today_uip,create_time, update_time, del_flag) " +
            "VALUES( #{param.fullShortUrl}, #{param.date}, #{param.todayPv}, #{param.todayUv},#{param.todayUip}, NOW(), NOW(), 0) " +
            "ON DUPLICATE KEY UPDATE " +
            "today_pv = today_pv +  #{param.todayPv}," +
            "today_uv = today_uv +  #{param.todayUv}," +
            "today_uip = today_uip +  #{param.todayUip};")
    void shortLinkTodayState(@Param("param") ShortLinkStatsTodayDO shortLinkStatsTodayDO);



}
